package model;
import java.sql.Date;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Observable;

import structures.Project;
import structures.ProjectListEntry;
import structures.Task;

/**
 * An abstract class to provide observable and define the behavior of the.
 * storage model
 * @author Darin Cyr
 * @version 1.0
 */
public abstract class ProjectDBModel extends Observable {
	public abstract void createNewProject(String projectName, 
			String ProjectDescription, 
			String date)throws  IllegalAccessException, ClassNotFoundException, 
			SQLException, InstantiationException;
	
	public abstract ArrayList<ProjectListEntry> getProjectNames()
			throws InstantiationException,
			IllegalAccessException,
			ClassNotFoundException,
			SQLException;

	public abstract Project getProject(int id)
			throws InstantiationException,
			IllegalAccessException,
			ClassNotFoundException,
			SQLException;
	
	public abstract void deleteProject(int id)
			throws InstantiationException,
			IllegalAccessException,
			ClassNotFoundException,
			SQLException;
	public abstract ArrayList<Task> getTasks(int projectId)
			throws InstantiationException,
			IllegalAccessException,
			ClassNotFoundException,
			SQLException;
	/**
	 *  I think this is outdated, superceded by...
	 *  HashMap<Integer, String> getTypeMap()
	 * @return an array of KvItem containing key-value pairs of type
	 * @throws InstantiationException when?
	 * @throws IllegalAccessException when?
	 * @throws ClassNotFoundException when?
	 * @throws SQLException when?
	 */
	public abstract Object[] getTypes()
			throws InstantiationException,
			IllegalAccessException,
			ClassNotFoundException,
			SQLException;
	
	public abstract Object[] getSubTypes()
			throws InstantiationException,
			IllegalAccessException,
			ClassNotFoundException,
			SQLException;
	public abstract HashMap<Integer, String> getTypeMap()
			throws InstantiationException, 
			IllegalAccessException, 
			ClassNotFoundException, 
			SQLException;
	public abstract HashMap<Integer, String> getSubtypeMap()
			throws InstantiationException, 
			IllegalAccessException, 
			ClassNotFoundException, 
			SQLException;
	public abstract void updateTask(Task task)
			throws  IllegalAccessException,
			ClassNotFoundException,
			SQLException, InstantiationException ;

	public abstract void insertTask(Task task)
			throws  IllegalAccessException,
			ClassNotFoundException,
			SQLException, InstantiationException;
	/**
	 *
	 * @param taskId The id of the task to be deleted
	 * @throws IllegalAccessException when?
	 * @throws ClassNotFoundException when?
	 * @throws SQLException when?
	 * @throws InstantiationException when?
	 */
	public abstract void deleteTask(int taskId)
			throws  IllegalAccessException,
			ClassNotFoundException,
			SQLException, InstantiationException;
}

